﻿namespace OasisCiq.Xml
{
    using System.Collections.Generic;
    using External;

    public class XLinkXmlReader
    {
        private const string XmlNS = XmlNamespaces.XLink;

        public IEnumerable<_XmlAttribute> Read(IXLink element, IEnumerable<_XmlAttribute> attributes)
        {
            // TODO: placeholder for reading xLink attributes
            foreach (var xmlAttribute in attributes)
            {
                if (xmlAttribute.NS == XmlNS)
                {
                    switch (xmlAttribute.Name)
                    {
                        case "type":
                        case "role":
                        case "arcrole":
                        case "title":
                        case "show":
                        case "actuate":
                        case "label":
                        case "from":
                        case "to":
                        case "href":
                            // continue; // processed
                            break; // TODO: Implement IXLink
                    }
                }

                yield return xmlAttribute; // not xLink
            }
        }
    }
}